#define  _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<math.h>
int main()
{
	int n;
	int hold = 0;
	long long s = 0;
	while (scanf("%d", &n) != EOF)
	{
		int a[1001] = { 0 };
		int b[1001] = { 0 };
		for (int i = 0;i < n;i++)
		{
			scanf("%d", &a[i]);
		}
		for (int i = 1;i <= n;i++)
		{
			scanf("%d", &b[n - i]);
		}

		for (int i = 0;i < n;i++)
		{
			s += a[i] * b[i];
		}
		printf("%lld\n", s);
		s = 0;
		hold = 0;
	}
	return 0;
}